package com.hzlx.operationParameters.service.impl;

import java.util.List;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import com.hzlx.operationParameters.mapper.OperationParametersMapper;
import com.hzlx.operationParameters.domain.OperationParameters;
import com.hzlx.operationParameters.service.IOperationParametersService;

/**
 * 工序参数Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-01
 */
@Service
public class OperationParametersServiceImpl implements IOperationParametersService 
{
    @Autowired
    private OperationParametersMapper operationParametersMapper;
    @Resource
    private RedisTemplate<String, Object> redisTemplateObject;
    String KEY = "base-data-service:operation_parameters";
    /**
     * 查询工序参数
     * 
     * @param paramId 工序参数主键
     * @return 工序参数
     */
    @Override
    public OperationParameters selectOperationParametersByParamId(Long paramId)
    {
        return operationParametersMapper.selectOperationParametersByParamId(paramId);
    }

    /**
     * 查询工序参数列表
     * 
     * @param operationParameters 工序参数
     * @return 工序参数
     */
    @Override
    public List<OperationParameters> selectOperationParametersList(OperationParameters operationParameters)
    {
        List<OperationParameters> list = operationParametersMapper.selectOperationParametersList(operationParameters);
        redisTemplateObject.opsForValue().set(KEY,list);
        return list;
    }

    /**
     * 新增工序参数
     * 
     * @param operationParameters 工序参数
     * @return 结果
     */
    @Override
    public int insertOperationParameters(OperationParameters operationParameters)
    {
        return operationParametersMapper.insertOperationParameters(operationParameters);
    }

    /**
     * 修改工序参数
     * 
     * @param operationParameters 工序参数
     * @return 结果
     */
    @Override
    public int updateOperationParameters(OperationParameters operationParameters)
    {
        return operationParametersMapper.updateOperationParameters(operationParameters);
    }

    /**
     * 批量删除工序参数
     * 
     * @param paramIds 需要删除的工序参数主键
     * @return 结果
     */
    @Override
    public int deleteOperationParametersByParamIds(Long[] paramIds)
    {
        return operationParametersMapper.deleteOperationParametersByParamIds(paramIds);
    }

    /**
     * 删除工序参数信息
     * 
     * @param paramId 工序参数主键
     * @return 结果
     */
    @Override
    public int deleteOperationParametersByParamId(Long paramId)
    {
        return operationParametersMapper.deleteOperationParametersByParamId(paramId);
    }
}
